<!DOCTYPE html>
<html>

<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title>KeyU DM TOOL</title>
	<link href="//unpkg.com/layui@2.9.18/dist/css/layui.css" rel="stylesheet">
	<!-- <link rel="stylesheet" href="./css/dark.css"> -->
	<script src="//unpkg.com/layui@2.9.18/dist/layui.js"></script>
	<link href="./css/toast.css" rel="stylesheet">
	<script src="./js/toast.js"></script>
	<link href="./css/main.css" rel="stylesheet">
	<script src="js/web.js"></script>
	<script src="js/main.js"></script>
</head>

<body>
	<!-- 添加顶部的标题 -->
	<div class="dynamic-header" style="text-align: center;  position: relative; overflow: hidden; padding: 8px;margin-bottom: 8px;">
		<div class="dynamic-bg"></div>
		<div class="header-content">
			<h1 style="color: #fff; margin: 0; position: relative; z-index: 2;">KeyU 弹幕模拟工具</h1>
		</div>
	</div>
	<div class="layui-row layui-col-space15 main">
		<form class="layui-form layui-row layui-col-space16">
			<div class="layui-col-xs12 layui-col-sm6 layui-col-md2">
				<div class="layui-input-wrap">
					<div class="layui-input-prefix">
						<i class="layui-icon layui-icon-home"></i>
					</div>
					<input type="text" name="roomId" placeholder="房间号" id="roomId" class="layui-input">
				</div>
			</div>
			<div class="layui-col-xs12 layui-col-sm6 layui-col-md2">
				<div class="layui-input-wrap" style="display: flex; align-items: center; ">
					<img style="height: 36px;border: rgb(238,238,238) 1px solid" id="head"
						src="http://www.h2t.me/cdn/huyouyun1.jpg" alt="">
					<input type="text" name="H" required placeholder="请选择玩家" id="demo-search-more" class="layui-input">
				</div>
			</div>
			<div class="layui-col-xs12 layui-col-sm6 layui-col-md3">
				<div class="layui-input-wrap">
					<div class="layui-input-prefix">
						<i class="layui-icon layui-icon-date"></i>
					</div>
					<select lay-search="" lay-filter="gifNumber" id="gifNumber">
						<option value="">礼物/点赞 数量</option>
						<option value="1">1</option>
						<option value="10">10</option>
						<option value="20">20</option>
						<option value="66">66</option>
						<option value="188">188</option>
						<option value="520">520</option>
						<option value="999">999</option>
						<option value="1314">1314</option>
					</select>
				</div>
			</div>
			<div class="layui-col-xs12 layui-col-sm6 layui-col-md3" style="display: flex; align-items: center; ">
				<div class="layui-input-wrap">
					<div class="layui-input-prefix">
						<i class="layui-icon layui-icon-dialogue"></i>
					</div>
					<input type="text" name="G" value="" placeholder="弹幕内容" class="layui-input" id="msg"
						style="width: auto;">
				</div>
				<button class="layui-btn" id="sendMsg">💬 发弹幕</button>
				<button class="layui-btn" id="sendLike">👍 点赞</button>
			</div>
			<div class="layui-col-xs12 layui-col-sm12 layui-col-md3" style="display: flex; align-items: center; ">
				<button class="layui-btn" id="send_tuan_up">🔼 升级</button>
				<button class="layui-btn" id="send_tuan_add">🙋‍♂️ 加团</button>
				<button class="layui-btn" id="send_jinfang">🚪 进房</button>
				<button class="layui-btn" id="send_guanzhu">➕ 关注</button>
				<button class="layui-btn" id="send_fenxiang">🚀 分享</button>
			</div>
		</form>
	</div>
	<hr>
	<div class="layui-row layui-col-space30 main">
		<div class="layui-col-xs12 layui-col-sm12 layui-col-md4 layui-col-lg3" id="userList">
			<div id="TPL1-template">
				<div class="layui-row layui-col-space15" id="TPL1">
					{{# layui.each(d.user, function(index, item){ }}
					<div class="user-item" data-index="{{= index}}"><span class="uindex">{{= index}}</span><img
							src="{{= item.head }}" alt=""><span
							style="display:inline-block;width:75px;overflow:hidden;text-overflow:ellipsis;">{{=
							item.name }}</span>
						<div class="layui-input-group" style="width:70px;height:30px;float:right;">
							<input type="text" name="" class="layui-input" value="{{= item.price }}">
						</div>
					</div>
					{{# }); }}
				</div>
			</div>
		</div>
		<div class="layui-col-xs12 layui-col-sm12 layui-col-md8 layui-col-lg4" id="gifList">
			<!-- 礼物筛选按钮 -->
			<div class="layui-btn-group" style="margin-bottom: 15px; text-align: center;">
				<button type="button" class="layui-btn gift-filter-btn active" data-filter="all">全部</button>
				<button type="button" class="layui-btn layui-btn-primary gift-filter-btn"
					data-filter="抖音小玩法">抖音小玩法</button>
				<button type="button" class="layui-btn layui-btn-primary gift-filter-btn"
					data-filter="TT平台">TT平台</button>
				<button type="button" class="layui-btn layui-btn-primary gift-filter-btn"
					data-filter="抖音直播">抖音直播</button>
			</div>
			<div id="TPL-template">
				<div class="layui-row layui-col-space15" id="TPL">
					{{# layui.each(d.gif, function(index, item){ }}
					<div class="layui-col-md3 layui-col-xs3 layui-col-sm3">
						<div class="layui-card gifItem" index="{{= index}}">
							<div class="layui-card-header" style="padding: 0px;"><span class="name">{{= item.礼物名称
									}}</span>
								<!--                            <span class="price">{{= item.单价 || '' }}</span>-->
								<span class="price">{{= (parseFloat(item.单价)*10).toFixed(0) || '' }}</span>
							</div>
							<div class="layui-card-body">
								<img draggable="false" class="img" style="width:48px;height: 48px;"
									src="img/{{= item.图片 }}" alt="">
							</div>
						</div>
					</div>
					{{# }); }}
				</div>
			</div>
		</div>
		<div class="layui-col-xs12 layui-col-sm12 layui-col-md12 layui-col-lg5">
			<div class="layui-form">
				<!--            <input type="text" name="" placeholder="脚本标题" class="layui-input">-->
				<!--            <hr class="ws-space-16">-->
				<textarea name="" placeholder="脚本内容编写" class="layui-textarea" id="hooyoocode">
gif(0,0,10);//第一个用户送第一个礼物（仙女棒）x10
gif(0,gid(),random(10,100));//第一个用户随机送一个礼物，送的数量是10-100之间的随机数
await sleep(2000);//延迟2秒
msg(uid(),"加入蓝方");//随机一个用户发弹幕 加入蓝方
for (let i = 0; i < 15; i++) {//循环15次
like(0,10)//第一个用户点10个赞
await sleep(50);//延迟2秒
like(uid(),10)//随机一个用户点10个赞
}
</textarea>
				<div class="layui-form" id="radio-container">
					<input type="radio" name="radio1" value="0" title="配置1" checked>
					<input type="radio" name="radio1" value="1" title="配置2">
					<input type="radio" name="radio1" value="2" title="配置3">
					<input type="radio" name="radio1" value="3" title="配置4">
					<input type="radio" name="radio1" value="4" title="配置5">
				</div>
				<hr>
				<button class="layui-btn" id="run-code">运行</button>
				<button class="layui-btn layui-btn-primary" id="save-code" lay-on="test-tips-prompt-0">保存</button>
				<hr>
				<pre><div><span style="color: #3366FF;">//</span><span
style="color: #3366FF;">KeyUScript使用示例（完全兼容js，拓展了js的方法）</span><span
style="color: #3366FF;">
</span><span style="color: #747474;">gif(</span><span style="color: #747474;">0</span><span
style="color: #000000;">,</span><span style="color: #747474;">0</span><span style="color: #747474;">,</span><span
style="color: #000000;">10</span><span style="color: #747474;">);</span><span
style="color: #3366FF;">//</span><span
style="color: #3366FF;">第一个用户送第一个礼物（仙女棒）x10(用户索引从0开始)</span><span
style="color: #3366FF;">
</span><span style="color: #747474;">gif(</span><span style="color: #747474;">0</span><span style="color: #747474;">,gid(),random(</span><span
style="color: #000000;">10</span><span style="color: #747474;">,</span><span
style="color: #000000;">100</span><span style="color: #747474;">));</span><span
style="color: #3366FF;">//</span><span
style="color: #3366FF;">第一个用户随机送一个礼物，送的数量是10-100之间的随机数</span><span
style="color: #3366FF;">
</span><span style="color: #747474;">await sleep(</span><span style="color: #747474;">2000</span><span
style="color: #000000;">);</span><span style="color: #3366FF;">//</span><span
style="color: #3366FF;">延迟2秒</span><span style="color: #3366FF;">
</span><span style="color: #747474;">msg(uid(),</span><span style="color: #800000;">&quot;</span><span
style="color: #800000;">加入蓝方</span><span style="color: #800000;">&quot;</span><span
style="color: #000000;">);</span><span style="color: #3366FF;">//</span><span
style="color: #3366FF;">随机一个用户发弹幕 加入蓝方</span><span style="color: #3366FF;">
</span><span style="color: #0000FF;">for</span><span style="color: #747474;"> (let i </span><span
style="color: #000000;">=</span><span style="color: #747474;"> </span><span style="color: #747474;">0</span><span
style="color: #000000;">; i </span><span style="color: #747474;">&lt;</span><span
style="color: #000000;"> </span><span style="color: #747474;">15</span><span
style="color: #000000;">; i</span><span style="color: #747474;">++</span><span
style="color: #000000;">) {</span><span style="color: #3366FF;">//</span><span
style="color: #3366FF;">循环15次</span><span style="color: #3366FF;">
</span><span style="color: #747474;">  like(</span><span style="color: #747474;">0</span><span
style="color: #000000;">,</span><span style="color: #747474;">10</span><span
style="color: #000000;">)</span><span style="color: #3366FF;">//</span><span
style="color: #3366FF;">第一个用户点10个赞</span><span style="color: #3366FF;">
</span><span style="color: #747474;">  await sleep(</span><span style="color: #747474;">50</span><span
style="color: #000000;">);</span><span style="color: #3366FF;">//</span><span
style="color: #3366FF;">延迟2秒</span><span style="color: #3366FF;">
</span><span style="color: #747474;">  like(uid(),</span><span style="color: #747474;">10</span><span
style="color: #000000;">)</span><span style="color: #3366FF;">//</span><span
style="color: #3366FF;">随机一个用户点10个赞</span><span style="color: #3366FF;">
</span><span style="color: #747474;">}</span></div></pre>
			</div>
		</div>
	</div>
	<div id="view"></div>


</body>

</html>